import API from '@/https/axios'
import { interfaceObj } from '@/https/urlConfig'

// 登录接口
export function getAccessToken(data: {
  username: string
  password: string
  code: string
  uuid: string
}) {
  return API.post<{
    data: {
      access_token: string
      expires_in: number
    }
    code: number
    msg: any
  }>({
    url: interfaceObj.authLogin,
    data,
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
  })
}
// 获取登录验证码接口
export function getCodeImg() {
  return API.get<{
    captchaEnabled: boolean
    code: string
    img: string
    msg: string
    uuid: string
  }>({
    url: interfaceObj.authCode,
    headers: {
      isToken: false,
    },
  })
}

// 登录查询用户信息
export function getInfo() {
  return API.get({
    url: '/system/user/getInfo',
  })
}
